<?php 
include_once(dirname(__FILE__)."/conn.php"); 

$qstr=isset($_GET["qstr"])?$_GET["qstr"]:"";
$dopost=isset($_POST["dopost"])?$_POST["dopost"]:"";

if ($dopost=="del"){
	$userIds = explode("`", $qstr);
	if(count($userIds)>0){
		$userClass = new user_user();
		try{
			foreach($userIds as $userId){
				$userClass->removeUser($userId);
			}
		}catch(Exception $e){
			ShowMsg("删除用户失败".$e->getMessage(), "user_list.php");
			exit();
		}
	}
	
	ShowMsg("删除成功！","user_list.php");
	exit();
}else{
?>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>删除用户</title>
<link rel="stylesheet" type="text/css" href="base.css">
</head>
<body leftmargin="8" topmargin='8'>
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#A5D0F1" style="BORDER-COLLAPSE: collapse">
  <tr> 
    <td width="100%" height="20" valign="top">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="30"><IMG height=14 src="img/book1.gif" width=20>
          &nbsp;删除用户
          </td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td width="100%" height="1" background="img/sp_bg.gif"></td>
  </tr>
  <tr> 
    <td width="100%" height="4"></td>
  </tr>
  <tr> 
    <td width="100%" height="20">
	<script language='javascript'>
<!--
function CheckSubmit()
{
	return true; 
}
--></script>
<form name='myform' method='POST' onSubmit='return CheckSubmit();' action=''>
<input type='hidden' name='dopost' value='del'>
<input type='hidden' name='qstr' value='<?php echo $qstr;?>'>
<table width='100%'  border='0' cellpadding='3' cellspacing='1' bgcolor='#A5D0F1'>
<tr bgcolor='#D2EFFD'>
<td colspan='2' background='img/wbg.gif'><font color='#666600'><b>你确实要删除以下用户？</b></font></td>
</tr>
<tr bgcolor='#D2EFFD'>
<td colspan='2' background='img/wbg.gif'><?php echo str_replace("`",",",$qstr);?></td>
</tr>
<tr>
<td colspan='2' bgcolor='#D2EFFD'>
<table width='270' border='0' cellpadding='0' cellspacing='0'>
<tr align='center'>
<td width='90'><input name='imageField1' type='image' class='np' src='img/button_ok.gif' width='60' height='22' border='0'></td>
<td width='90'></td>
<td><a href='#'><img src='img/button_back.gif' width='60' height='22' border='0' onClick='history.go(-1);'></a></td>
</tr>
</table>
</td>
</tr></table></form>

    </td>
  </tr>
  <tr> 
    <td width="100%" height="2" valign="top"></td>
  </tr>
</table>
<p align="center">

<br>
<br>
</p>
</body>
</html><?php
}
?>